import sequelize from "../../db/dbConnext";
import { option } from "../../db/commomConfig";
import { DataTypes } from "sequelize";

import SysUserEntity from "../../../entities/system/SysUserEntity";
export type ISysUser = Omit<SysUserEntity, "validateThis" | "roleIds">;

const SysUser = sequelize.define<any, ISysUser>(
  "sys_user",
  {
    nickname: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    loginId: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    loginPwd: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    status: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    userType: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    email: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    phone: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    sex: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    avatar: {
      type: DataTypes.STRING,
      allowNull: true,
    },
  },
  option
);
export default SysUser;
